package com.kaifamiao.month03.day0331.bank.dao;

import com.kaifamiao.month03.day0331.bank.model.Account;
import com.kaifamiao.month03.day0331.bank.util.ArrayListForAccount;


public class AccountDao {

    static ArrayListForAccount list = new ArrayListForAccount();

    // 存储用户信息
    public void save(Account account) {
        list.add(account);
    }

    // 验证用户账户密码是否正确
    public Account isRight(String phone, String pass) {
        return list.isRight(phone, pass);
    }

    // 查询用户信息
    public Account showAccount(String phone) {
       return list.getAccount(phone);
    }

    // 删除用户信息，并返回删除的用户
    public Account remove(int index) {
        return list.remove(index);
    }

    // 获取用户的下标
    public int getIndex(Account account) {
        return list.getIndex(account);
    }

    // 查询所有用户信息
    public Account[] findAll() {
        return list.findAll();
    }

}
